<template>
  <div class="itinerary">
    <!-- <sec-header></sec-header> -->
    <div class="travel-wrapper">
      <!-- 左侧地图 -->
      <div class="map-wrapper">
        <sec-map></sec-map>
      </div>
      <!-- 右侧内容区 -->
      <div class="plan-wrapper">
        <div class="plan-header">
          <div class="title">
            <img :src="img" alt="" />
            <div class="title-shape"></div>
            <div class="plan-photo">
              <div class="travel-title">
                <p>您的 旅行前往</p>
                <p>中国北京</p>
              </div>
            </div>
            <el-carousel ref="carouselRef" :autoplay="false" arrow="never" trigger="click" height="150px">
              <el-carousel-item :name="index + ''" v-for="(item, index) in carousels" :key="index">
                <h3 class="carousel-title">{{ item.title }}</h3>
                <div class="carousel-content">{{ item.content }}</div>
              </el-carousel-item>
            </el-carousel>
            <ul class="carousel__indicators_custom">
              <li @click="indicatorsClick(index)" :class="{ active: selIndex === index }" v-for="(item, index) in carouselIcon" :key="index">
                <i :class="[item]"></i>
              </li>
            </ul>
          </div>
        </div>
        <sec-days-list></sec-days-list>
      </div>
    </div>
  </div>
</template>

<script>
import secHeader from "../header";
import secDaysList from "./components/daysList.vue";
import secMap from "./components/map.vue";
export default {
  name: "itinerary",
  props: {},
  components: { secHeader, secDaysList, secMap },
  data() {
    return {
      selIndex: 0,
      img: require("@/assets/plan.jpeg"),
      carousels: [
        {
          title: "地点",
          content:
            "北京是一座繁华的城市，交通拥堵，因此请合理规划您的行程，并预留额外的出行时间。北京是一座繁华的城市，交通拥堵，因此请合理规划您的行程，并预留额外的出行时间。北京是一座繁华的城市，交通拥堵，因此请合理规划您的行程，并预留额外的出行时间。北京是一座繁华的城市，交通拥堵，因此请合理规划您的行程，并预留额外的出行时间。",
        },
        { title: "天气", content: "北京属大陆性气候，夏季炎热潮湿，冬季寒冷干燥。" },
        { title: "语言", content: "普通话是北京的主要语言。" },
      ],
      carouselIcon: ["el-icon-map-location", "el-icon-cloudy-and-sunny", "el-icon-house"],
    };
  },
  computed: {},
  mounted() {},
  methods: {
    indicatorsClick(index) {
      this.selIndex = index;
      this.$refs.carouselRef.setActiveItem(index);
    },
  },
  watch: {},
};
</script>
<style lang="scss" scoped>
//@import url(); 引入公共css类
.itinerary {
  width: 100%;
  height: 100%;
}
.travel-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  .map-wrapper {
    position: fixed;
    top: 0;
    bottom: 0;

    width: 55%;
    height: 100%;
    background: $theme-color;
  }
  .plan-wrapper {
    width: 45%;
    height: 100%;
    margin-left: 55%;
    .plan-header {
      position: relative;
      box-shadow: rgb(131, 56, 253) 0px 25px 100px 20px;
      border-radius: 0 0 50px 50px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      margin: 0 32px;
      .title {
        position: relative;
        width: 100%;
        height: 20rem;
        border-radius: 0px 0px 50px 50px;
        justify-content: start;

        img {
          position: absolute;
          height: 100%;
          width: 100%;
          inset: 0px;
          object-fit: cover;
          color: transparent;
          border-radius: 0px 0px 50px 50px;
          justify-content: start;
        }
        .title-shape {
          width: 100%;
          height: 100%;
          position: absolute;
          border-radius: 0px 0px 50px 50px;
          background: linear-gradient(0deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4));
        }
        .plan-photo {
          position: absolute;
          color: #fff;
          width: 100%;
          margin-top: 4.5rem;
          text-align: center;
          z-index: 99;
          .travel-title {
            font-size: 16px;
            font-weight: 700;
            & :nth-child(2) {
              font-size: 36px;
            }
          }
        }
      }
    }
  }
}

.el-carousel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -40px;
  width: 60%;
  min-height: 12rem;
  z-index: 99;
  background: rgba(131, 56, 253, 0.5);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  text-align: center;
  color: #fff;
  padding: 0 15px;

  ::v-deep .el-carousel__indicators {
    display: none;
  }
  .carousel-title {
    margin: 25px 0 6px 0;
    font-size: 16px;
    font-weight: 600;
  }
  .carousel-content {
    font-size: 13px;
    line-height: 20px;
    height: 80px;
    overflow: auto;
  }
}
.carousel__indicators_custom {
  position: absolute;
  bottom: -20px;
  z-index: 999;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  li {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 25px;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 27px;
    height: 27px;
    cursor: pointer;
    &.active {
      color: $theme-color;
      background: #fff;
    }
    i {
      font-weight: 600;
    }
    &:last-child {
      margin-right: 0;
    }
  }
}
</style>
